<?php require_once 'httpFilter.php'; 'conf.php'; ?>

<html>
<title>Transaction view</title>
<head>
	<link rel="stylesheet" type="text/css" media="screen" href="css/styles.css" />
	<link rel="stylesheet" type="text/css" media="screen" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.0/themes/ui-lightness/jquery-ui.css" />
	

<script type="text/javascript"
	src="http://www.google.com/jsapi?key=ABQIAAAAN5ZtdO4QwxMtTu20xDDGaBRDmw7J9fBy0SHOM2DFag_Hy1S5lhQ5rqB1kcjLa1mWGmKBHM2W7xPDyQ">
</script>
<script>
	google.load("jquery", "1.4.2");
	google.load("jqueryui", "1.7.2");
</script>

<script type="text/javascript" src="accountDetails.js">
</script>
</head>
<body>
	<div id="msgDlg"></div>
	<div id="confirmDlg"></div>
		
	<!-- NAVIGATION -->
	<?php include("includes/navigation.php"); ?>
	<?php
$con = mysql_connect(GlobalConfig::db_host_name, GlobalConfig::db_username, GlobalConfig::db_password);
if (!$con) {
	die('Could not connect: ' . mysql_error());
}

mysql_select_db(GlobalConfig::db_name, $con);

$accountId = $_GET["accId"];

$result = mysql_query("select * from account where id = " . $accountId);

$row = mysql_fetch_array($result);
?>
	<input type="hidden" id="accountId" value="<?=$row["id"]?>"/>
	<table width="400">
		<caption>"Getting Rich Slowly"</caption>
		<tr>
	    <th scope="row" colspan="2" class="spec"><?= $row["name"]?></th>
	  </tr>
	  <tr>
			<td width="150">Opening Balance</td>
			<td>R <input class="currency" type="text" id="openingBal" value="<?= $row["openingBalance"]?>"/></td>
		</tr>
		 <tr>
			<td width="150">Account name</td>
			<td><input class="textInput" type="text" id="accName" value="<?= $row["name"]?>"/></td>
		</tr>
	 <tr>
			<td width="150">Current Balance</td>
			<td>R <?= $row["balance"]?></td>
		</tr>
		<tr>
			<td width="150">Statement Balance</td>
			<td>R <?= $row["stmtBalance"]?></td>
		</tr>
	  <tr>
			<td width="150">Creation Date</td>
			<td><?= $row["creationDate"]?></td>
		</tr>
		<tr>
			<td width="150">Account Number</td>
			<td><input class="textInput" type="text" id="accNum" value="<?= $row["accNum"]?>"/></td>
		</tr>
		<tr>
			<td width="150">Active</td>
			<td>
			<? if ($row["active"] == 1){ ?>
			 	<input type="checkbox" class="checkbox" name="Active" value="active" checked="true"/>
			<?} else {?>
				<input type="checkbox" class="checkbox" name="Active" value="active"/>
			<?} ?>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<th class="specalt"><button id="saveBtn">Save</button>
				<button>Cancel</button>
			</th>
		</tr>
	</table>
	 <?php

mysql_close($con);
?>

<?php include("includes/footer.php"); ?>
</body>

</html>